<?php

namespace App\Modules\Admin\Repositories\Transformers;

use App\Models\CultureVoice;
use League\Fractal\TransformerAbstract;

class CultureVoiceListTransformer extends TransformerAbstract
{
    public function transform(CultureVoice $cultureVoice)
    {
        return [
            'id' => $cultureVoice->id,
            'title' => $cultureVoice->title,
            'url' => $cultureVoice->url,
            'cover' => $cultureVoice->cover,
            'content' => html_entity_decode($cultureVoice->content),
            'created_at' => $cultureVoice->created_at != null ? $cultureVoice->created_at->toDateTimeString() : null,
        ];
    }
}
